package icom.icss.dao;

import icom.icss.entity.User;

import java.sql.SQLException;
import java.util.List;

public interface UserDao {
    /**
     *
     * @param username
     * @param password
     * @return
     * @throws SQLException
     */
    User selcetByUsernameAndPassword(String username, String password) throws SQLException;

    /**
     * 查询用户是否存在
     *
     * @param username
     * @return
     * @throws SQLException
     */
    boolean checkUsername(String username) throws SQLException;

    /**
     * 获取所有用户的条数
     * @return
     */
    int getTotalCount() throws SQLException;


    /**
     * 分页查询用户列表
     * @param index,当前页的第一条记录的索引
     * @param count,当前页显示多少条数据
     * @return
     */
    List<User> getUserListByLimit(int index, int count) throws SQLException;

    /**
     *
     * @param username
     */
    void  deleteUser(String username) throws SQLException;

    /**
     *删除
     * @param username
     * @throws SQLException
     */
    void  deleteAllUser(String username) throws SQLException;

    /**
     * 查询该用户信息
     * @param username
     * @return
     * @throws SQLException
     */
    User selectName(String username) throws SQLException;

    /**
     * 更新
     * @param user
     */
    void updatePassword(User user) throws SQLException;
}
